#ifndef CUBOID_DIALOG_H
#define CUBOID_DIALOG_H

#include <QDialog>
#include <QtGui>
#include "cuboidPrimitive.h"
#include "objectTreeItem.h"

class CuboidDialog : public QDialog{
    Q_OBJECT

    public:
        CuboidDialog(int, QWidget * = 0);
        CuboidDialog(CuboidPrimitive *, ObjectTreeItem *, QWidget * = 0);
        ~CuboidDialog();

    signals:
        void done(Object *);
        void redoOctree(Object *);
        void rotateOctree(Object *, int, int, int);

    private:
        CuboidPrimitive *cuboid;
        ObjectTreeItem *item;
        bool onlyRotated, rotated;
        bool onlyChangedColor;
        int id, colorR, colorG, colorB, colorAlpha, rotationX, rotationY, rotationZ;
        double minX, minY, minZ, maxX, maxY, maxZ;

        QPushButton *colorPushButton;

        QDoubleSpinBox *minXDoubleSpinBox;
        QDoubleSpinBox *minYDoubleSpinBox;
        QDoubleSpinBox *minZDoubleSpinBox;
        QDoubleSpinBox *maxXDoubleSpinBox;
        QDoubleSpinBox *maxYDoubleSpinBox;
        QDoubleSpinBox *maxZDoubleSpinBox;


        void createLayout();
        void setButtonColor();

    private slots:
        void acceptAndCreate();
        void changeColor();
        void changeMinX(double);
        void changeMinY(double);
        void changeMinZ(double);
        void changeMaxX(double);
        void changeMaxY(double);
        void changeMaxZ(double);
        void changeRotationX(int);
        void changeRotationY(int);
        void changeRotationZ(int);
};

#endif
